package com.cn.jsdr.controller;

import com.cn.jsdr.service.QueryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("test")
public class QueryController {
    @Autowired
    private QueryService queryService;
    @RequestMapping("tt")
    @ResponseBody
    public Map get(){
        String sqlid="1";
        Map paraMap =new HashMap();
        paraMap.put("usname","刘言");
        Map m = queryService.getMap(sqlid,paraMap);
        System.out.println(m.get("usname"));
        return m;
    }
    @PostMapping(value = "csid")
    @ResponseBody
    public List<Map<String, Object>> get(@RequestBody Map<String, Object> map){
        String sqlid=map.get("sqlid")+"";
        Map paraMap =new HashMap();
        paraMap.putAll(map);
        List<Map<String, Object>> m = queryService.getListMaps(sqlid,paraMap);
        return m;
    }
}
